//请使用js内置对象-数组对象和双重循环的知识打印金字塔
let a = []
let b = ''
for (let i = 0; i < 10; i++) {
    //左边
    for (let j = 0; j < 10 - i; j++) {
        //document.write('<div class="item">&nbsp;</div>')
        b += '<div class="item">&nbsp;</div>'
    }
    //右边
    for (let k = 0; k < i * 2 + 1; k++) {
        // document.write('<div class="item">*</div>')
        if (k % 2 === 0) {
            b += '<div class="item">*</div>'
        } else {
            b += '<div class="item">&nbsp;</div>'
        }

    }
    // document.write('<br>')
    b += '<br>'

}
a.push(b);
document.write(a)